package org.onion.pattern.event.springboot.rocketmq.autoconfigure;


import org.apache.rocketmq.client.MQAdmin;
import org.onion.pattern.event.spring.autoconfigure.OnionPatternEventAutoConfigure;
import org.onion.pattern.event.springboot.rocketmq.config.RocketMQEventProperties;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;


@Configuration(proxyBeanMethods = false)
@ComponentScan("org.onion.pattern.event.springboot.rocketmq")
@ConditionalOnClass(MQAdmin.class)
@AutoConfigureAfter(OnionPatternEventAutoConfigure.class)
public class RocketMQEventAutoConfigure {

    @Bean
    @ConfigurationProperties(prefix = "onion-pattern.event.rocketmq")
    public RocketMQEventProperties rocketMQEventProperties(){
        return new RocketMQEventProperties();
    }

}
